p = p.env(format!("DEP_{}_OUT_DIR", name).as_slice(),
Some(&layout.native(pkg)));
}
+ let pkg = pkg.to_string();
Ok(proc() {
if first {
internal("failed to create output directory for build command")
}));
}
- try!(p.exec_with_output().map(|_| ()).map_err(|e| e.mark_human()));
+ try!(p.exec_with_output().map(|_| ()).map_err(|mut e| {
+ e.msg = format!("Failed to run custom build command for `{}`\n{}",
+ pkg, e.msg);
+ e.mark_human()
+ }));
Ok(())
})
}
"#);
assert_that(p.cargo_process("build"),
execs().with_status(101).with_stderr(format!("\
+Failed to run custom build command for `foo v0.5.0 ({dir})
Process didn't exit successfully: `{}` (status=101)\n\
--- stderr\n\
task '<main>' failed at 'nope', {filename}:2\n\
\n\
-", build.bin("foo").display(), filename = format!("src{}foo.rs", path::SEP))));
+", build.bin("foo").display(), filename = format!("src{}foo.rs", path::SEP),
+ dir = p.url())));
})
test!(custom_second_build_failure {
"#);
assert_that(p.cargo_process("build"),
execs().with_status(101).with_stderr(format!("\
+Failed to run custom build command for `foo v0.5.0 ({dir})
Process didn't exit successfully: `{}` (status=101)\n\
--- stderr\n\
task '<main>' failed at 'nope', {filename}:2\n\
\n\
-", build2.bin("bar").display(), filename = format!("src{}bar.rs", path::SEP))));
+", build2.bin("bar").display(), filename = format!("src{}bar.rs", path::SEP),
+ dir = p.url())));
})
test!(custom_build_env_vars {